当连接mongo时 提示“node is not in primary or recovering state”

您所在的位置:网站首页 mongodb not in 当连接mongo时 提示“node is not in primary or recovering state”

当连接mongo时 提示“node is not in primary or recovering state”

#当连接mongo时 提示“node is not in primary or recovering state” | 来源: 网络整理| 查看: 265

背景: 用docker安装的mongo,并设置了一个副本集。且用rs.initiate()初始化过。长时间没用了,突然打开就报错了。想知道如何可以把数据保留下来且修复这个问题。

用rs查看mongo状态如下:

> rs.status() { “ok” : 0, “errmsg” : “Our replica set config is invalid or we are not a member of it”, “code” : 93, “codeName” : “InvalidReplicaSetConfig” } > rs.conf().members [ { “_id” : 0, “host” : “242f13dd6839:27017”, “arbiterOnly” : false, “buildIndexes” : true, “hidden” : false, “priority” : 1, “tags” : {

}, “slaveDelay” : NumberLong(0), “votes” : 1 } ]

添加节点时报错:

{ “topologyVersion” : { “processId” : ObjectId(“60ae136dda794cff135bcf27”), “counter” : NumberLong(1) }, “ok” : 0, “errmsg” : “New config is rejected :: caused by :: replSetReconfig should only be run on a writable PRIMARY. Current state REMOVED;”, “code” : 10107, “codeName” : “NotWritablePrimary” }

本地解决办法:删除原docker镜像以及容器,重新安装一遍就好了。



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3